package uaiContacts.model;
import java.io.Serializable;
import java.math.BigInteger;
import java.util.Date;
import javax.persistence.Basic;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.NamedQueries;
import javax.persistence.NamedQuery;
import javax.persistence.Table;
import javax.persistence.Temporal;
import javax.persistence.TemporalType;
import javax.validation.constraints.NotNull;
import javax.validation.constraints.Size;
import javax.xml.bind.annotation.XmlRootElement;

/**
 *
 * @author Droog
 */
@Entity
@Table(name = "tb_bens_patrimoniais", catalog = "sistema_ipi", schema = "public")
public class BensPatrimoniais implements Serializable {
    private static final long serialVersionUID = 1L;
    @Id
    @GeneratedValue(strategy = GenerationType.IDENTITY)
    @Basic(optional = false)
    @Column(name = "id_bem_patrimonal", nullable = false)
    private Integer idBemPatrimonal;
    @Basic(optional = false)
    @Column(name = "dsc_bem_patrimonial", nullable = false, length = 40)
    private String dscBemPatrimonial;
    @Column(name = "nr_nota_fiscal", length = 10)
    private String nrNotaFiscal;
    @Column(name = "nom_doador", length = 20)
    private String nomDoador;
    // @Max(value=?)  @Min(value=?)//if you know range of your decimal fields consider using these annotations to enforce field validation
    @Column(name = "vlr_bem_patrimonial", precision = 2147483647, scale = 0)
    private Double vlrBemPatrimonial;
    @Column(name = "img_bem_patrimonial")
    private BigInteger imgBemPatrimonial;
    @Basic(optional = false)
    @Column(name = "ind_ativo", nullable = false)
    private boolean indAtivo;
    @Basic(optional = false)
    @Column(name = "dat_cadastro", nullable = false)
    @Temporal(TemporalType.TIMESTAMP)
    private Date datCadastro;
    @JoinColumn(name = "id_igreja", referencedColumnName = "id_igreja", nullable = false)
    @ManyToOne(optional = false)
    private DadosIgreja idIgreja;
    @JoinColumn(name = "id_ministerio", referencedColumnName = "id_ministerio", nullable = false)
    @ManyToOne(optional = false)
    private Ministerio idMinisterio;

    public BensPatrimoniais() {
    }

    public BensPatrimoniais(Integer idBemPatrimonal) {
        this.idBemPatrimonal = idBemPatrimonal;
    }

    public BensPatrimoniais(Integer idBemPatrimonal, String dscBemPatrimonial, boolean indAtivo, Date datCadastro) {
        this.idBemPatrimonal = idBemPatrimonal;
        this.dscBemPatrimonial = dscBemPatrimonial;
        this.indAtivo = indAtivo;
        this.datCadastro = datCadastro;
    }

    public Integer getIdBemPatrimonal() {
        return idBemPatrimonal;
    }

    public void setIdBemPatrimonal(Integer idBemPatrimonal) {
        this.idBemPatrimonal = idBemPatrimonal;
    }

    public String getDscBemPatrimonial() {
        return dscBemPatrimonial;
    }

    public void setDscBemPatrimonial(String dscBemPatrimonial) {
        this.dscBemPatrimonial = dscBemPatrimonial;
    }

    public String getNrNotaFiscal() {
        return nrNotaFiscal;
    }

    public void setNrNotaFiscal(String nrNotaFiscal) {
        this.nrNotaFiscal = nrNotaFiscal;
    }

    public String getNomDoador() {
        return nomDoador;
    }

    public void setNomDoador(String nomDoador) {
        this.nomDoador = nomDoador;
    }

    public Double getVlrBemPatrimonial() {
        return vlrBemPatrimonial;
    }

    public void setVlrBemPatrimonial(Double vlrBemPatrimonial) {
        this.vlrBemPatrimonial = vlrBemPatrimonial;
    }

    public BigInteger getImgBemPatrimonial() {
        return imgBemPatrimonial;
    }

    public void setImgBemPatrimonial(BigInteger imgBemPatrimonial) {
        this.imgBemPatrimonial = imgBemPatrimonial;
    }

    public boolean getIndAtivo() {
        return indAtivo;
    }

    public void setIndAtivo(boolean indAtivo) {
        this.indAtivo = indAtivo;
    }

    public Date getDatCadastro() {
        return datCadastro;
    }

    public void setDatCadastro(Date datCadastro) {
        this.datCadastro = datCadastro;
    }

    public DadosIgreja getIdIgreja() {
        return idIgreja;
    }

    public void setIdIgreja(DadosIgreja idIgreja) {
        this.idIgreja = idIgreja;
    }

    public Ministerio getIdMinisterio() {
        return idMinisterio;
    }

    public void setIdMinisterio(Ministerio idMinisterio) {
        this.idMinisterio = idMinisterio;
    }

    @Override
    public int hashCode() {
        int hash = 0;
        hash += (idBemPatrimonal != null ? idBemPatrimonal.hashCode() : 0);
        return hash;
    }

    @Override
    public boolean equals(Object object) {
        // TODO: Warning - this method won't work in the case the id fields are not set
        if (!(object instanceof BensPatrimoniais)) {
            return false;
        }
        BensPatrimoniais other = (BensPatrimoniais) object;
        if ((this.idBemPatrimonal == null && other.idBemPatrimonal != null) || (this.idBemPatrimonal != null && !this.idBemPatrimonal.equals(other.idBemPatrimonal))) {
            return false;
        }
        return true;
    }

    @Override
    public String toString() {
        return "model.BensPatrimoniais[ idBemPatrimonal=" + idBemPatrimonal + " ]";
    }
    
}
